home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / pbaseiv.zip / P4UTL000.TIP < prev    next >
Text File  |  1991-12-16  |  3KB  |  104 lines

  1. If you use TSR (terminate and stay resident) programs such
  2. as SideKick, you know that they can eat up precious memory.
  3. If you need that memory back--say, to load a big
  4. worksheet--you may have to reboot. And if the TSR is loaded
  5. by AUTOEXEC.BAT, rebooting isn't enough; you'll have to edit
  6. or rename AUTOEXEC.BAT first.
  7.  
  8. ALTKEY.COM is a 10-byte solution to this problem, allowing
  9. you to choose whether your TSRs are loaded at boot time.
  10. [It's included, in executable form, in the P4UTIL directory
  11. on your PowerBase *.* Volume IV diskette.]
  12.  
  13. To use ALTKEY.COM, move it to a directory listed in your
  14. PATH command, and modify your AUTOEXEC.BAT file to look
  15. something like:
  16.  
  17. ALTKEY
  18.  
  19. IF ERRORLEVEL 8 GOTO NO-TSRS
  20. .
  21. .
  22. .
  23. [Commands to install TSRs]
  24. .
  25. .
  26. .
  27. :NO-TSRS
  28. .
  29. .
  30. .
  31. [Rest of AUTOEXEC.BAT]
  32.  
  33. Under a normal reboot, your TSRs will load. But if the <Alt>
  34. key is held down when ALTKEY.COM executes inside
  35. AUTOEXEC.BAT, it will return ERRORLEVEL 8, and the batch
  36. file will skip the TSRs.
  37.  
  38. If you prefer, you can use a key other than <Alt> [see
  39. instructions below]. Be careful with <Num Lock>, however; in
  40. many PCs with extended keyboards, <Num Lock> is turned on
  41. automatically at boot time.
  42.  
  43. Brian Elwood
  44. Lincoln, Nebraska
  45.  
  46. Editor's note: ALTKEY.COM has many uses and will work
  47. wherever you want the state of a key to influence a batch
  48. file's execution. Changing the program to use a key like
  49. <Num Lock> isn't necessarily a bad idea, since users don't
  50. have to worry about holding it down; they can set the key
  51. one way and think about something else while the batch runs.
  52. The same is true of <Scroll Lock>, <Caps Lock>, and
  53. <Insert>, all of which toggle their states when pushed. If
  54. you wish to create a version of ALTKEY.COM that uses a key
  55. other than the <Alt> key, use the <Alt-F> command to copy
  56. the listing below into an ASCII text file called ALTKEY.SCR.
  57. (Make sure not to delete the blank line before the line that
  58. says `rcx'!) Then, change the "8" in the line that says MOV
  59. AL,8 to one of the numbers in the table below, and the word
  60. ALTKEY on the first line to something more appropriate (e.g.
  61. NUMKEY for <Num Lock>). Finally, type DEBUG < ALTKEY.SCR at
  62. the DOS prompt. When you use your modified program, remember
  63. that the ERRORLEVEL returned when your chosen key is
  64. depressed will no longer be be 8; it'll be the number you
  65. entered in the MOV AL,<number> instruction.
  66.  
  67. ALTKEY.SCR
  68.  
  69. ---- BEGIN LISTING ----
  70. nALTKEY.COM
  71. a100
  72. MOV     AH,2
  73. INT     16
  74. AND     AL,8
  75. MOV     AH,4C
  76. INT     21
  77.  
  78. rcx
  79. a
  80. w
  81. q
  82. ---- END LISTING ----
  83.  
  84.  
  85. Table: Codes for PC Shift Keys
  86.  
  87. Key           Code
  88. ---           ----
  89. Right Shift    1
  90. Left Shift     2
  91. Ctrl           4
  92. Alt            8
  93. Scroll Lock   16
  94. Num Lock      32
  95. Caps Lock     64
  96. Insert       128
  97.  
  98.  
  99. Title: Alt Alternates
  100. Category: Misc
  101. Issue date: Dec 1991
  102. Editor: Brett Glass
  103. Supplementary files: P4UTIL\ALTKEY.COM
  104.